package com.abraxascorp.model;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.GeoPt;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

/**
 * Represents an Abraxas Location
 * 
 * @author devin.partlow
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Location implements Serializable {

	private static final long serialVersionUID = -5225086220601606166L;

	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private String contact = "";
	
	@Persistent
	private String profilePicUrl = "";
	
	@Persistent
	private GeoPt location;
	
	@Persistent
	private Text description;
	
	public Location() {
	}
	
	public Location(String contact, String profilePicUrl, GeoPt location, String description) {
		this.contact = contact;
		this.profilePicUrl = profilePicUrl;
		this.location = location;
		this.description = new Text(description);
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getProfilePicUrl() {
		return profilePicUrl;
	}

	public void setProfilePicUrl(String profilePicUrl) {
		this.profilePicUrl = profilePicUrl;
	}

	public GeoPt getLocation() {
		return location;
	}

	public void setLocation(GeoPt location) {
		this.location = location;
	}

	public Text getDescription() {
		return description;
	}

	public void setDescription(Text description) {
		this.description = description;
	}
	
}
